using UnityEngine;
using System.Collections;

public class Cannon : MonoBehaviour 
{
	public Texture cannonTexture;
	public Vector2 frames = new Vector2();
	public Vector2 startingFrame = new Vector2();
	enum Type{STANDARD, DOUBLE, CLUSTER, SNIPER, MAGNET, MINIGUN };
	Type type;
	Sprite sprite;
	
	void Awake()
	{
		sprite = new Sprite(this.transform, frames, startingFrame);
		renderer.material.SetTexture("_MainTex",cannonTexture);
		type = Type.STANDARD;
	}
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		//TypeChange();
	}
	/// <summary>
	/// Changes the type of the tank.
	/// </summary>
	void TypeChange()
	{
		switch(type)
		{
			case Type.STANDARD:
				sprite.setFrame(startingFrame);
				break;
			case Type.DOUBLE:
				sprite.setFrame(new Vector2(0,0));
				break;
			case Type.CLUSTER:
				
				break;
			case Type.SNIPER:
				
				break;
			case Type.MAGNET:
				
				break;
			case Type.MINIGUN:
				
				break;
			
		}
	}
}
